package br.com.processo.persistencia.dao;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;

import br.com.processo.modelo.Setor;

public class SetorDAO extends GenericDAOImpl<Setor>{

	public Setor getTipoSetorPorDescricao(String descricao) {
		Session session = getSession();
		Criteria criteria = session.createCriteria(Setor.class);
		criteria.add(Restrictions.eq("tipoSetor", descricao));

		Setor setor = (Setor) criteria.uniqueResult();

		return setor;
	}

}
